package com.gylang.im.core.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gylang.commons.dto.BaseDTO;
import com.gylang.mapper.domain.BaseDO;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @author gylang
 * data 2020/11/25
 * @version v0.0.1
 */
public interface BaseService<T extends BaseDO, D extends BaseDTO> extends IService<T> {

    D findOne(D d);

    List<D> selectList(D d);

    boolean save(D dto);

    boolean insertBatch(Collection<D> entityList);

    boolean insertBatch(Collection<D> entityList, int batchSize);

    boolean insertOrUpdateBatch(Collection<D> entityList);

    boolean insertOrUpdateBatch(Collection<D> entityList, int batchSize);

    boolean updateById(D entity);

    boolean updateBatch(Collection<D> entityList);

    boolean updateBatch(Collection<D> entityList, int batchSize);

    boolean saveOrUpdate(D entity);

    D findById(Serializable id);

    List<D> findByIds(Collection<? extends Serializable> idList);


}
